//
// Created by Semir on 2020/4/12.
//

#include <iostream>

using namespace std;

const int MAX_N = 40;
int n;
long long dp[1000];

int main() {
    cin >> n;
    int sum = n * (n + 1) >> 1;
    if (sum % 2 == 1) {
        cout << 0 << endl;
        return 0;
    } else {
        sum = sum >> 1;
    }
    dp[0] = 1;
    for (int i = 1; i <= n; i++) {
        for (int j = sum; j >= i; j--) {
            dp[j] = dp[j] + dp[j - i];
        }
    }
    cout << (dp[sum] >> 1) << endl;
    return 0;
}
